package dxn.nl.file.client.model.dto;

import lombok.Data;

import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;

@Data
public class CsExportExcelHeadDto implements Comparable<CsExportExcelHeadDto> {
    /**
     * 列头名
     */
    private List<String> title;
    /**
     * 字段名
     */
    private String key;
    /**
     * 主排序
     */
    private int order;

    private int columnLength;

    private Type dataType;

    public CsExportExcelHeadDto(String key, List<String> title, int order, int columnLength)
    {
        this.key = key;
        this.title = title;
        this.order = order;
        this.columnLength = columnLength;
    }

    public CsExportExcelHeadDto(String key, List<String> title, int order)
    {
        this.key = key;
        this.title = title;
        this.order = order;
    }

    public CsExportExcelHeadDto(String key, String title, int order, int columnLength)
    {
        this.key = key;
        this.title = Arrays.asList(title);
        this.order = order;
        this.columnLength = columnLength;
    }

    public CsExportExcelHeadDto(String key, String title, int order)
    {
        this.key = key;
        this.title = Arrays.asList(title);
        this.order = order;
    }

    public CsExportExcelHeadDto()
    {

    }

    @Override
    public int compareTo(CsExportExcelHeadDto o) {
        return this.order - o.getOrder();
    }
}
